import myAxios from "@/request";
import type {
  PaymentBillQueryRequest,
  PaymentBillAddRequest,
  PaymentBillUpdateRequest,
} from "@/models/paymentBill";

/**
 * 分页获取缴费记录列表
 */
export function listPaymentBillByPage(
  paymentBillQueryRequest: PaymentBillQueryRequest
) {
  return myAxios.request({
    url: "/api/paymentBill/list/page",
    method: "post",
    data: paymentBillQueryRequest,
  });
}

/**
 * 添加缴费记录
 */
export function addPaymentBill(paymentBillAddRequest: PaymentBillAddRequest) {
  return myAxios.request({
    url: "/api/paymentBill/add",
    method: "post",
    data: paymentBillAddRequest,
  });
}

/**
 * 更新缴费记录
 */
export function updatePaymentBill(
  paymentBillUpdateRequest: PaymentBillUpdateRequest
) {
  return myAxios.request({
    url: "/api/paymentBill/update",
    method: "post",
    data: paymentBillUpdateRequest,
  });
}

/**
 * 删除缴费记录
 */
export function deletePaymentBill(id: number) {
  return myAxios.request({
    url: "/api/paymentBill/delete",
    method: "post",
    data: { id },
  });
}
